1. Field of the Invention
The present invention relates to a network device in a data network and more particularly to the mirroring of data received by a network device.
2. Description of the Related Art
A packet switched network may include one or more network devices, such as a Ethernet switching chip, each of which includes several modules that are used to process information that is transmitted through the device. Specifically, the device includes an ingress module, a Memory Management Unit (MMU) and an egress module. The ingress module includes switching functionality for determining to which destination port a packet should be directed. The MMU is used for storing packet information and performing resource checks. The egress module is used for performing packet modification and for transmitting the packet to at least one appropriate destination port. One of the ports on the device may be a CPU port that enables the device to send and receive information to and from external switching/routing control entities or CPUs.
In order to properly monitor packets, often the packet flow needs to be monitored to determine if the network device is functioning properly. In prior art devices, the packets being sent to a given port could be “mirrored” to another port where the packet flow could be examined. The mirroring process is important in that the flow of the packets to a given destination port need not be interrupted to examine the flow to that destination port. Therefore, in these devices, the packets that were received by a “mirrored-to” port were examined at the latter port with no disruption to the flow of packets to the actual destination port.
For most prior art network devices, for a destination or source port, only one mirrored-to port may be specified. However, there is a need for a network device to mirror packets to multiple ports. Furthermore, if a packet received at a given port of a network device is forwarded to another port, the header may be modified to aid in that forwarding operation. Thus, packets that are mirrored are modified as a consequence of forwarding the packet. However, there is also a need for mirroring modified and unmodified packets.